const throttle = (func, delay) => {
	let timer = null
	return function(...args) {
		if (!timer) { //判断timer是否有值,如果没有则说明定时器不存在即可继续执行
			uni.showLoading({title: '加载中'});
			timer = setTimeout(() => { //关
				uni.hideLoading();
				func.apply(this, arguments)
				timer = null; //开
			}, delay)
		}
	}
}

export default throttle